package com.hong.alert;

import models.GenerationRate;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**sFs
 * Handles requests for the application home page.
 */
@Controller
public class HomeController {

	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String home(GenerationRate generationRate) {
		return "index";
	}

	@RequestMapping(value = "/", method = RequestMethod.POST)
	public ModelAndView display(GenerationRate generationRate, Model model) {
		model.addAttribute(generationRate);
		return new ModelAndView("display");
	}

}
